<?php

class TestController extends Zend_Controller_Action
{

    public function indexAction()
    {
        $this->_helper->layout->disableLayout();

        try
        {
            $conn = Doctrine_Manager::connection();
            $conn->beginTransaction();

            $profile = new Profile();
            $profile->save();

            $user = new User();
            $user->username = 'gato';
            $user->email = 'gato@umbook.com';
            $user->profile = $profile;

            $user->save();
            
            $conn->commit();

        } catch (Exception $e)
        {
            $conn->rollback();

            echo $e->getMessage();
        }

        $this->view->profile = $profile;
        $this->view->user = $user;
    }

}

